package com.weilus.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
@Validated
public class User{

	@NotNull(message = "{param.user.name.null}")
	@Size(min=4,max=10,message = "{param.user.name.size}")
	private String name;

	@Range(min=1,max=100,message = "{param.user.age}")
	private int age;

	@Pattern(regexp="[a-zA-Z]{5,20}",message="{param.user.txt}")
	private String txt;

	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date birthDate;
}
